package local.blueheart.springboot.chapter21.config;


import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Order 调整配置类的加载顺序 数字越小，越靠前
 * @Configuration 表明是一个配置，注入到容器
 * @EnableTransactionManagement(proxyTargetClass = true) 启用事务
 * @EnableJpaRepositories(basePackages = "local.**.repository") 启用JpaRepository
 * @EntityScan(basePackages = "local.**.model") 自动注入实体模型配置
 */
@Order(Ordered.HIGHEST_PRECEDENCE)
@Configuration
@EnableTransactionManagement(proxyTargetClass = true)
@EnableJpaRepositories(basePackages = "local.**.repository")
@EntityScan(basePackages = "local.**.model")
public class JpaConfiguration {
}
